package com.sotb.sender;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * 
 * @author lgb
 * 3个按钮
 *
 */
public class SenderActivity extends Activity {
    /** Called when the activity is first created. */
	private Button send_sms = null;
	private Button setting = null;
	private Button stop_send_sms = null;
	private Button start_service = null;
	private Button recording = null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        send_sms = (Button) findViewById(R.id.send_sms);
        setting = (Button) findViewById(R.id.setting);
        stop_send_sms = (Button) findViewById(R.id.stop_send_sms);
        start_service = (Button) findViewById(R.id.start_service);
        recording = (Button) findViewById(R.id.recording);
        //这个按钮现在可以删除了
        send_sms.setOnClickListener(new OnClickListener() {			
			//@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(SenderActivity.this, SMSSenderService.class);
				startService(intent);
			}
		});
        setting.setOnClickListener(new OnClickListener() {
			
			//@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();				
				intent.setClass(SenderActivity.this, SettingActivity.class);
				startActivity(intent);
			}
		});
        stop_send_sms.setOnClickListener(new OnClickListener() {
			
			//@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(SenderActivity.this, SMSSenderService.class);
				stopService(intent);
			}
		});
        start_service.setOnClickListener(new OnClickListener() {
			
			//@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(SenderActivity.this, SenderService.class);
				startService(intent);
			}
		});
        recording.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(SenderActivity.this, Recording.class);
				startActivity(intent);
			}
		});
     }
}